import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

/*element*/
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

/*公共样式*/
import './assets/css/me.css'

/*axios*/
import axios from 'axios'
axios.defaults.baseURL = 'https://www.liulongbin.top:8888/api/private/v1'

/*tree-table*/
import TreeTable from 'vue-table-with-tree-grid'

/**
 * 配置axios拦截器 添加token验证
 * @type {AxiosStatic}
 */
axios.interceptors.request.use(config => {
  console.log(config);
  config.headers.Authorization = window.sessionStorage.getItem('token');
  /**必须返回config*/
  return config;
})

// 将axios 挂载到Vue 原型上
Vue.prototype.$http = axios

Vue.config.productionTip = false
Vue.use(ElementUI)

Vue.component('tree-table',TreeTable)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
